import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';

export default function (app, { swaggerPath = 'api/swagger' }) {
  const config = new DocumentBuilder()
    .setTitle('接口文档')
    .setDescription('minimart：')
    .setVersion('1.0')
    .addBearerAuth()
    .build();
  const document = SwaggerModule.createDocument(app, config);
  SwaggerModule.setup(swaggerPath, app, document, {
    jsonDocumentUrl: 'swagger/json',
    // 个性化样式
    customCssUrl: '/css/theme-outline.css',
    useGlobalPrefix: true,
  });
}
